home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_td.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-30  |  7.9 KB  |  170 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="330" caption="Table data cell">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblAlignVertical" caption="Vertical align" hint="Choose how your cell should be aligned vertically." width="77" height="13" top="64" left="232"/>
  6.             <label name="lblAlign" caption="Align" hint="Choose how your cell should be aligned." width="42" height="13" top="16" left="232"/>
  7.             <label name="lblRowSpan" caption="Rowspan" hint="Choose if you want your cell to span over a number of rows." width="45" height="13" top="64" left="120"/>
  8.             <label name="lblColSpan" caption="Colspan" hint="Choose if you want your cell to span over a number of columns." width="38" height="13" top="64" left="8"/>
  9.             <spinedit name="speWidth" taborder="0" hint="Width of your cell." maxvalue="0" minvalue="0" value="100" width="65" height="20" top="32" left="8"/>
  10.             <checkbox name="cbWidth" caption="Width" taborder="1" hint="Check if the width should be hardcoded." checked="0" width="65" height="14" top="16" left="8"/>
  11.             <checkbox name="cbWidthPercent" caption="%" taborder="2" hint="Choose between width measured in percentages (relative) or pixels (absolute)." checked="1" width="37" height="17" top="34" left="76"/>
  12.             <spinedit name="speHeight" taborder="3" hint="Height of your cell." maxvalue="0" minvalue="0" value="100" width="65" height="20" top="32" left="120"/>
  13.             <checkbox name="cbHeight" caption="Height" taborder="4" hint="Check if the width should be hardcoded." checked="0" width="57" height="14" top="16" left="120"/>
  14.             <checkbox name="cbHeightPercent" caption="%" taborder="5" hint="Choose between width measured in percentages (relative) or pixels (absolute)." checked="1" width="35" height="17" top="34" left="190"/>
  15.             <combobox name="comAlign" taborder="6" text="" hint="Choose how your cell should be aligned." width="160" height="21" top="32" left="232">
  16.                 <items>
  17.                     left
  18.                     center
  19.                     right
  20.                     justify
  21.                     char
  22.                 </items>
  23.             </combobox>
  24.             <spinedit name="speColSpan" taborder="7" hint="Choose if you want your cell to span over a number of columns." maxvalue="0" minvalue="0" value="0" width="65" height="20" top="80" left="8"/>
  25.             <spinedit name="speRowSpan" taborder="8" hint="Choose if you want your cell to span over a number of rows." maxvalue="0" minvalue="0" value="0" width="65" height="20" top="80" left="120"/>
  26.             <combobox name="comAlignVertical" taborder="9" text="" hint="Choose how your cell should be aligned vertically." width="160" height="21" top="80" left="232">
  27.                 <items>
  28.                     top
  29.                     middle
  30.                     bottom
  31.                     baseline
  32.                 </items>
  33.             </combobox>
  34.             <checkbox name="cbColor" caption="Background color" taborder="10" hint="Select a background color for your cell. Only included if the above checkbox is checked." checked="0" width="121" height="14" top="112" left="8"/>
  35.             <coloredit name="cleColor" taborder="11" text="#000000" hint="" width="105" height="19" top="128" left="8"/>
  36.         </panel>
  37.     </controls>
  38.     <dialogevents>
  39.         <event type="onclose" resulttype="ok">
  40.             StartCode := ('<td');
  41.             If comAlign.Text <> '' then
  42.              StartCode := StartCode + ' align="'+comAlign.Text+'"';
  43.             If comAlignVertical.Text <> '' then
  44.              StartCode := StartCode + ' valign="'+comAlignVertical.Text+'"';
  45.             
  46.             If speColSpan.Value > 0 then
  47.              StartCode := StartCode + ' colspan="'+IntToStr(speColSpan.Value)+'"';
  48.             If speRowSpan.Value > 0 then
  49.              StartCode := StartCode + ' rowspan="'+IntToStr(speRowSpan.Value)+'"';
  50.             If cbColor.Checked then
  51.              StartCode := StartCode + ' bgcolor="'+cleColor.HTMLValue+'"';
  52.             if cbWidth.Checked then
  53.              begin
  54.                StartCode := StartCode + ' width="'+IntToStr(speWidth.Value);
  55.               if cbWidthPercent.Checked then
  56.                StartCode := StartCode + '%';
  57.               StartCode := StartCode + '"'; 
  58.              end;
  59.             if cbHeight.Checked then
  60.              begin
  61.                StartCode := StartCode + ' height="'+IntToStr(speHeight.Value);
  62.               if cbHeightPercent.Checked then
  63.                StartCode := StartCode + '%';
  64.               StartCode := StartCode + '"'; 
  65.              end;
  66.  
  67.               If edtCSSClass.Text <> '' then
  68.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  69.               If edtCSSId.Text <> '' then
  70.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  71.               If edtCSSStyle.Text <> '' then
  72.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  73.             for i := 0 to EventGrid.Count - 1 do
  74.               begin
  75.               if EventGrid.Rows[i].EditText <> '' then
  76.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  77.              end;               
  78.              
  79.             StartCode := StartCode + '>';
  80.             EndCode := '</td>';              
  81.             If cbMakeXHTMLCompliant.Checked then
  82.              StartCode := MakeXHTMLCompliant(StartCode, true);
  83.             If cbDoPHPEscape.Checked then
  84.              StartCode := DoPHPEscape(StartCode);         
  85.             // A little "hack" - WebCoder will set this, to let us know whether to update
  86.             // an existing tag, or insert a brand new one
  87.             If cbUpdateExistingTag.Checked then 
  88.              ReplaceTag(StartCode)
  89.             else 
  90.                InsertTags(StartCode, EndCode);   
  91.               
  92.         </event>
  93.         <event type="onshow">    
  94.             // Lets put the advanced panel in the right place
  95.             pnlAdvanced.Parent := MainPanel;
  96.             pnlAdvanced.Left := 8;
  97.             pnlAdvanced.Top := MainPanel.Height - 32;        
  98.             pnlAdvanced.Width := Self.Width - 36;
  99.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  100.             If pnlAdvanced.Height > 20 then
  101.              Self.Height := Self.Height + 200;
  102.         </event>
  103.         <event type="updatedialog">
  104.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  105.             // The entire selected tag will be passed as a parameter to this function, that should update
  106.             // the required fields of the dialog.
  107.             function UpdateDialog(Tag: string);
  108.              begin
  109.  
  110.               comAlign.Text := GetValueFromAttribute(Tag, 'align'); 
  111.               comAlignVertical.Text := GetValueFromAttribute(Tag, 'valign'); 
  112.               
  113.               ColSpan := GetValueFromAttribute(Tag, 'colspan');
  114.               If ColSpan <> '' then
  115.                speColSpan.Value := StrToInt(ColSpan);
  116.               RowSpan := GetValueFromAttribute(Tag, 'rowspan');
  117.               If RowSpan <> '' then
  118.                speRowSpan.Value := StrToInt(RowSpan);
  119.                               
  120.               bgColor := GetValueFromAttribute(Tag, 'bgcolor');
  121.               If bgColor <> '' then
  122.                begin
  123.                 cleColor.SelColor := ConvertColor(bgColor);
  124.                 cbColor.Checked := true;
  125.                 end;    
  126.  
  127.               Width := GetValueFromAttribute(Tag, 'width');
  128.               If Width[Length(Width)] = '%' then
  129.                begin
  130.                 Delete(Width, Length(Width), 1);
  131.                 cbWidthPercent.Checked := true;
  132.                end
  133.               else
  134.                cbWidthPercent.Checked := false; 
  135.               If Width <> '' then 
  136.                begin
  137.                 cbWidth.Checked := true; 
  138.                 speWidth.Value := StrtoInt(Width);
  139.                end;         
  140.                 
  141.               Height := GetValueFromAttribute(Tag, 'height');
  142.               If Height[Length(Height)] = '%' then
  143.                begin
  144.                 Delete(Height, Length(Height), 1);
  145.                 cbHeightPercent.Checked := true;
  146.                end
  147.               else
  148.                cbHeightPercent.Checked := false;                
  149.               If Height <> '' then 
  150.                begin
  151.                 cbHeight.Checked := true;
  152.                  speHeight.Value := StrtoInt(Height);                
  153.                 end; 
  154.                                          
  155.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  156.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  157.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  158.               for i := 0 to EventGrid.Count - 1 do
  159.                 begin
  160.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  161.                  If EventVal <> '' then
  162.                   EventGrid.Rows[i].EditText := EventVal;
  163.                end;  
  164.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  165.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  166.              end;
  167.         </event>
  168.     </dialogevents>
  169. </dialog>
  170.